package com.mezz.bones.im.logic.controller;

import com.mezz.bones.framework.base.domain.response.Result;
import com.mezz.bones.im.logic.domain.request.*;
import com.mezz.bones.im.logic.service.IChatUserRemarkService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api("IM用户备注管理")
@RequestMapping("/im/user/remark")
@RestController
public class ChatUserRemarkController {

    @Resource
    private IChatUserRemarkService chatUserRemarkService;

    @PostMapping("/setting")
    @ApiOperation("设置备注")
    public Result<String> apiUserRemarkSetting(@Valid @RequestBody ApiUserRemarkSettingRequest request) {

        chatUserRemarkService.saveUserRemark(request);

        return Result.OK();
    }

    @PostMapping("/clear")
    @ApiOperation("清楚备注")
    public Result<String> apiUserRemarkClear(@Valid @RequestBody ApiUserRemarkClearRequest request) {

        chatUserRemarkService.clearUserRemark(request);
        return Result.OK();
    }

}
